<?php
namespace app\command;

use app\model\OrdersModel;
use think\console\Command;
use think\console\Input;
use think\console\Output;

class BatchHandleTimeOutOrder extends Command
{
    protected function configure()
    {
        $this->setName('批量处理过期未支付订单')
            ->setDescription('这是批量处理过期未支付订单的脚本');
    }

    protected function execute(Input $input, Output $output)
    {
        // 执行你的脚本任务代码
        $ordersModel = new OrdersModel();
        $batchHandleTimeOutOrderNum = $ordersModel->batchHandleTimeOutOrder();
        $output->writeln(date("Y-m-d H:i:s").'本次执行处理' . $batchHandleTimeOutOrderNum . '条订单');
    }
}